package com.wc.alorithm_luogu.P5711;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/4/18 9:45
 * @description
 * https://www.luogu.com.cn/problem/P5711
 * 闰年判断
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int year = sc.nextInt();
        int ans;

        if (year%4==0){
            ans = 1;
            if (year%100==0){
                ans=0;
            }
            if (year%400==0){
                ans=1;
            }
        }else {
            ans = 0;
        }
        System.out.println(ans);
    }
}
